import pickle
import json
import rsa

license_data = {
    "original_project_Author": "KitChen",
    "softwareVersion": "1.0.0",
    # 其他 license 信息...
}
license_json = json.dumps(license_data, sort_keys=True).encode('utf-8')


with open('public_key.pem', 'rb') as f_pub:
    public_key = pickle.load(f_pub)

encrypted_message = rsa.encrypt(license_json, public_key)


with open('signature.bin', 'wb') as f:
    # 写入bytes数据
    f.write(encrypted_message)
